import { defineConfig } from 'vitepress'
import {getMarkdownFiles} from "../utils/getMarkdownFiles";

// https://vitepress.dev/reference/site-config
export default defineConfig({
  title: "My Awesome Project",
  description: "A VitePress Site",
  //最近一条内容的更新时间会显示在页面右下角
  lastUpdated: true,
  //主题配置
  themeConfig: {
    // https://vitepress.dev/reference/default-theme-config
    nav: [
      { text: 'Home', link: '/' },
      { text: 'Examples', link: '/docs/examples/Examples.md' },
      { text: 'API', link: '/docs/api/API.md' },
    ],

    //根据页面路径显示不同的侧边栏
    sidebar: {
      '/docs/examples/': [
        ...getMarkdownFiles('./docs/examples')
      ],
      '/docs/api/': [
        ...getMarkdownFiles('./docs/api')
      ]
    },

    //社交链接参考 https://vitepress.dev/zh/reference/default-theme-config#sociallinks
    socialLinks: [
      { icon: 'github', link: 'https://github.com/vuejs/vitepress' },
      { icon: 'gitee', link: 'https://github.com/vuejs/vitepress' },
    ],

    //本地搜索
    search: {
      provider: 'local'
    },

    //在 GitHub 或 GitLab 等 Git 管理服务上编辑页面
    editLink: {
      pattern: 'https://github.com/vuejs/vitepress/edit/main/docs/:path'
    },

    //页脚支持 HTML 字符串
    footer: {
      message: 'Released under the <a href="https://github.com/vuejs/vitepress/blob/main/LICENSE">MIT License</a>.',
      copyright: 'Copyright © 2019-present <a href="https://github.com/yyx990803">Evan You</a>'
    }
  }
})
